home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** Program: MacShell
- ** File: eventloop.c
- ** Originally from: Traffic Light 2.0 (2.0 version by Keith Rollin)
- ** Modified by: Eric Soldan
- **
- ** Copyright © 1990-1991 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "MacShell.h" /* Get the MacShell includes/typedefs, etc. */
- #include "MacShellCommon.h" /* Get the stuff in common with rez. */
- #include "MacShell.protos" /* Get the prototypes for MacShell. */
-
- #ifndef __TEXTEDITCONTROL__
- #include "TextEditControl.h"
- #endif
-
-
-
- /*****************************************************************************/
-
-
-
- extern RgnHandle gCursorRgn; /* The current cursor region.
- ** The initial cursor region is
- ** an empty region, which will
- ** cause WaitNextEvent to generate
- ** a mouse-moved event, which will
- ** cause us to set the cursor for
- ** the first time.
- */
- extern Boolean gQuitApplication; /* This is set to false by
- ** Initialize. When the user
- ** selects Quit (and does not
- ** abort the quit), then this
- ** boolean is set true.
- */
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- /* Get events forever, and handle them by calling DoEvent. Get the events by
- ** calling WaitNextEvent. (This sample does a DeathAlert if WaitNextEvent
- ** isn't available.)
- */
-
- #pragma segment Main
- void EventLoop(void)
- {
- EventRecord event;
-
- while (!gQuitApplication) {
- WaitNextEvent(everyEvent, &event, 15, gCursorRgn);
- DoEvent(&event);
- };
- }
-
-
-
-